home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / FaceWare / FaceWare.rsrc / TEXT_1267_V9. Resources.txt < prev    next >
Text File  |  1994-04-10  |  7KB  |  28 lines

  1. V9. Resources
  2.   Most FaceWare modules contain some resources that can be removed if the corresponding functionality is not used.  This is especially true with ViewIt since it contains a large number of resources used to support its editing mode and on-line help, neither of which are necessary to open ViewIt windows.  The following discussion outlines the steps you can take to customize resources, add modules to an existing application file to create a stand-alone application, and/or remove unused resources.
  3.  
  4. Shared FaceWare File
  5.   During development of programs that use ViewIt, it is best to keep ViewIt and other FaceWare modules in the shared "FaceWare" file.  Not only does this make modules available to more than one program under development, but it saves time since you can run your programs without having to wait for resources to be added after each compilation.
  6.   Upon completion of a project, you have the option of either moving a copy of the FaceWare modules that your program uses to the final application file, or of distributing a copy of the FaceWare file with your application. The first approach tends to be used by developers of commercial products, and the latter by in-house developers who find it convenient to keep one copy of the FaceWare file in their System folder.
  7.  
  8. Custom Resources
  9.   Each FaceWare module in the FaceWare file consists of a group of similarly-numbered resources.  All of the basic control (BaseCt) driver's resources, for example, have resource IDs between 1310 and 1389.  Most programmers do not modify these private resources since they are used by code within BaseCt.  In some cases, however, you may find a need to make minor modifications such as changing the size or position of a built-in window, translating the English strings to another language, etc.
  10.   The safe way to "customize" such module resources is to copy the resources of interest to your application file (or the temporary resource file used by your application) and then make the necessary modifications in that file.  These customized versions will then be used in place of the ones in the FaceWare file since the program file gets precedence over the FaceWare file when searching for resources.  The creation of a local copy ensures that (1) the FaceWare file is never corrupted, (2) editing done while in ViewIt's edit mode can be saved (the FaceWare file is write-protected while running your program), and (3) the changes made will not affect other programs.
  11.   If, for example, you wanted all of ViewIt's prompt strings to appear in French, you could simply use ResEdit or other editor to move a copy of ViewIt's STR# resources to your program file (or other resource file used by your program), and translate the English strings to French.
  12.   To customize the copied resources, use ViewIt's on-line edit mode, ResEdit, or other resource editor.  Fonts, styles, text, window size, positions, etc., can usually be changed without affecting the operation of the parent module.  On the other hand, you should avoid changing the order and type of controls in windows unless documentation states that such changes are supported.
  13.  
  14. Stand-Alone Programs
  15.   If you decide that you do not want to distribute a copy of the FaceWare file with your program, then you'll need to use the "MoveIt" application to move the FaceWare modules needed by your program to your program file.  This step is typically followed by using ResEdit (or other resource editor) to add all of the ".Rsrc" resources from your temporary res file, which is then followed by adding Finder-related resources (described in "Finder Resources" topic), and finally by removing any unneeded resources:
  16.  (1) Use MoveIt to move modules to program file.
  17.  (2) Use ResEdit to move .Rsrc resources to program file.
  18.  (3) Use ResEdit to move Finder resources to program file.
  19.  (4) Use ResEdit to remove any unneeded resources.
  20.   The modules shipped with ViewIt include built-in on-line help in the form of TEXT and styl resources that will not be needed in finished applications.  The ViewIt module also includes extra code that is used to support on-line editing.  To simplify the task of removing these resources, a special version of the FaceWare file is included on the FW Utilities disk that does not include these editing-related resources.  Thus if you do not want these resources in your finished application, use this smaller version of the FaceWare file when moving modules with MoveIt.
  21.   Step (1) involves opening the FaceWare file and your application file within MoveIt, and then moving just the modules you need from the FaceWare file to the application.  The modules that you need will probably include ViewIt and FaceIt (unless using FaceSt), plus any control drivers that support controls in your ViewIt windows (you can determine this by looking at the driver info for each control in the Control dialog).  BaseCt is almost always needed.  HelpCt will be needed if you are using any help controls, ScrapCt if you included a clipboard display control, etc.
  22.   Step (2) is easy.  Use ResEdit to copy all of the resources in your .Rsrc file to the application file.  Doing this after using MoveIt to move modules ensures that any customized module resources that you've placed in the .Rsrc file will replace those moved with MoveIt from the FaceWare file.
  23.   Step (3) is described in the "Finder Resources" topic of the FaceIt guide.
  24.   Step (4) involves using ResEdit to remove other unnecessary module resources.  The EditControls, CommControl, and QuickControl modules, for example, all contain on-line help related resource that can be removed (see their accompanying documentation for further info.).
  25.  
  26. Missing Resources
  27.   After adding modules from the non-editing version of the FaceWare file to your finished program, you may find that some resources which you've been using are missing.  This can occur if (1) you've been inadvertently using ViewIt editing-related resources with your own controls (such as when an SICN-based icon button from a ViewIt editing window is copied for use in your own windows), or (2) you imported an example control from the Import menu which has additional example resources linked to it, and the "Auto-Add" option was not on.
  28.   The resource ID numbers of such missing resources will be between 1100 and 7499 (the range of module IDs).  To fix this problem, copy the missing resource from the editing version of the FaceWare file and paste it into your resource file.  It is also a good idea to renumber this copied resource (use ID < 1100 or ID > 7499) and link the control to this renumbered resource to avoid future problems.